#pragma once
#include "WareTypes.h"
#include "wareassert.h"
#include "waremath.h"

BEGIN_WARECOMMON

class CVector2
{
public:
	// Construct 
	inline CVector2() : x(0.0f), y(0.0f) {}

	inline CVector2( float32 m1, float32 m2 ) : x( m1 ), y( m2 ){}

	inline CVector2( const CVector2& v ) : x( v[0] ), y( v[1] ) {}

	// operaor
	inline CVector2  operator+( const CVector2& v ); // value copy
	inline CVector2  operator-( const CVector2& v );
	inline CVector2  operator*( const float32 scale );
	inline CVector2  operator-() const;
	inline CVector2& operator=( const CVector2& v );
	//CVector2  operator*( CVector2& v );
	inline CVector2& operator+=( const CVector2& v );
	inline CVector2& operator-=( const CVector2& v );

	// logic operator
	inline VBOOL operator==( const CVector2& v );
	inline VBOOL operator!=( const CVector2& v );

	inline float32  operator[]( const int32 i ) const;
	inline float32& operator[]( const int32 i );

	inline float32 Dot( const CVector2& v );
	inline float32 Dot( const CVector2& v, const CVector2& u );
	inline CVector2 Cross( const CVector2& v, const CVector2& u );
	inline CVector2 Cross( const CVector2& u );

	//CVector2 Product( float32 k );
	//void    Product( CVector2& v, float32 k );

	inline float32 Lenght();
	inline void    Normalize();

private:
	float32 x;
	float32 y;
};

#include "CVector2.hpp"

END_WARECOMMON